//
//  QQGroupViewController.m
//  HTHappySale
//
//  Created by 曾华桥 on 17/9/26.
//  Copyright © 2017年 zxyywy. All rights reserved.
//

#import "QQGroupViewController.h"
#import "HTTPPromise+Me.h"

//Tools
#import "AppUtil.h"
@interface QQGroupViewController ()
{
    
}
@property(nonatomic,strong)UIImageView *qqImgView;
@end

@implementation QQGroupViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self loadData];
}

-(void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    [self addNavigationLeftView:@"" andType:0];
    [self addNavigationMiddleView:@"QQ群"];
}

-(void)loadData{
    __weak __typeof(self)weakSelf = self;
    [HTTPPromise requestQQgroupParams:nil Success:^(id responseObj){
        __strong __typeof(weakSelf)strongSelf = weakSelf;
        NSLog(@"%@",responseObj);
        int code = [[responseObj objectForKey:@"ret"] intValue];
        if(code  == 0){
            [strongSelf loadImage:[responseObj objectForKey:@"image"]];
        }else{
            [AppUtil showTipMessage:responseObj[@"desc"]];
        }
    } failure:^(NSError *error){
        NSLog(@"%@",error.userInfo);
    }];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    
}



@end
